package cui.xin.studentcourse.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cui.xin.studentcourse.bean.Course;
import cui.xin.studentcourse.bean.Middle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CourseMapper extends BaseMapper<Course> {
    public List<Course> selectTop10();

    public List<Course> selectSex();

    /**
     * 学生选课
     * @param middle
     * @return
     */
    int insertCourse(Middle middle);

    /**
     * 查询学生未选的课程
     * @return
     */
    List<Course> selectCourseList(Long studentId);

    /**
     * 根据条件查询 学生未选过的课程
     * @param condition
     * @param studentId
     * @return
     */
    List<Course> selectListByCondition(@Param("condition") String condition, @Param("studentId") Long studentId);

    /**
     * 退课的模糊查询
     * @param condition
     * @return
     */
    List<Course> queryCourseByCondition(@Param("condition") String condition,@Param("studentId") Long studentId);
}
